Example: HP 620

Analyzing the DSDT DSL

By looking at the DSL file, we find the registers we are interested in:

        OperationRegion (ECRM, EmbeddedControl, 0x00, 0xFF)
        Field (ECRM, ByteAcc, NoLock, Preserve)
        {
            [...]
            Offset (0xD1), 
            BTY,    32, 
            MFAC,   8, 
            CFAN,   8,
            PFAN,   8,
            [...]
        }

Calculating the register addresses

We calculate the register addresses as follows:

Finding the WriteRegister

We use the probing tool to find out which register controls the fan:

sudo ec_probe write 214 0
sudo ec_probe write 214 20
sudo ec_probe write 214 50

Nothing has happened here

sudo ec_probe write 215 0
sudo ec_probe write 215 20
sudo ec_probe write 215 50

The fan changed its speed

Result: PFAN is the WriteRegister, CFAN is the ReadRegister

Finding the ReadRegister values

We ensure that the fan is turned off (or at least at the minimum speed).

sudo ec_probe read 214

Output: 20

We run stress -c 8 to stress the system and spin up the fan.

sudo ec_probe read 214

Output: 90

Result: 20 is the MinSpeedValue and 90 is the MaxSpeedValue

Finding the WriteRegister values

We use the probing tool to find the values that stop the fan and set the fan to full speed:

sudo ec_probe write 215 0
sudo ec_probe write 215 10
[...]
sudo ec_probe write 215 255

We see that:

Writing the configuration file

See the configuration file on GitHub